var status = -1;
var selectionLog = [];

function action(d, c, b) {
    if (status == 0 && d == 0) {
        cm.dispose();
        return
    }
    status++;
    selectionLog[status] = b;
    var a = -1;
    if (status <= a++) {
        cm.dispose()
    } else {
        if (status === a++) {
            if (cm.isQuestActive(1846)) {
                cm.dispose();
                cm.warp(957020005, 0, true);
                return
            }
            cm.npc_ChangeController(9075100, "oid=59308", 67, 56, 16, 17, 117, 1, false, 0, false);
            cm.npc_ChangeController(9075006, "oid=59309", 67, 56, 16, 17, 117, 1, false, 0, false);
            cm.npc_ChangeController(9075105, "oid=59310", -192, 136, 3, -242, -142, 1, false, 0, false);
            cm.npc_ChangeController(9075110, "oid=59311", 286, 136, 8, 236, 336, 1, false, 0, false);
            cm.npc_ChangeController(9075008, "oid=59312", 67, 56, 16, 17, 117, 1, false, 0, false);
            if (!cm.isQuestFinished(1802)) {
                cm.setQuestCustomData(1802, "完成");
                cm.updateInfoQuest(1816, "linkOpen6=0;linkOpen7=0;linkOpen8=0;linkOpen9=0;coreSlot1=0;coreSlot2=0");
                cm.updateInfoQuest(1818, "q1833=0;q1834=0;q1835=0;q1836=0;q1837=0;q1838=0");
                cm.forceStartQuest(1831, "0");
                cm.forceStartQuest(1839, "0");
                cm.forceStartQuest(1840, "0");
                cm.updateInfoQuest(1842, "visit=0;invite=0;use=0")
            }
            cm.dispose()
        } else {
            cm.dispose()
        }
    }
}

function start() {
    status = -1;
    action(1, 0, 0)
};